home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9112 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.9 KB  |  46 lines

  1. Newsgroups: comp.lang.c++
  2. Path: bath.ac.uk!uwe-bristol!pa-ross
  3. From: pa-ross@pat.uwe.ac.uk (P Ross)
  4. Subject: Linking MikMod 2.03 to Watcom c++ code
  5. Message-ID: <1996Feb27.131614.12598@pat.uwe.ac.uk>
  6. Sender: usenet@pat.uwe.ac.uk (uwe nntp usenet poster)
  7. Nntp-Posting-Host: usenet@pat.uwe.ac.uk (uwe nntp usenet poster)
  8. Organization: University of the West of England, Bristol
  9. Date: Tue, 27 Feb 1996 13:16:14 GMT
  10.  
  11. For all linking gurus and wizards here are a couple of questions that have
  12. stopped me dead in my tracks and I can't go on until I find the answers :(
  13.  
  14. o Linking MikMod 2.03 to watcom c++
  15. -----------------------------------
  16. I can create all the libraries, compile the code no problems. However I want
  17. to use this library from within my own c++ code. When I try and call
  18. the function it says function <whatever> is an undefined reference. I've
  19. compiled the code using wcc386. I've checked that all the header files
  20. contain extern "C" {} before and after the function prototypes, so what gives?
  21. Has anyone managed this before ?
  22. I've tried _everything_ I can think of. Using extern "C", putting underscores
  23. on the function names, converting the code to compile with wpp386 (which just
  24. crashes when I run it), putting all the object files into one library, etc
  25. etc. _Please_ help !!!!!!!!!!!!!!!!!!!!!!!!!!!
  26.  
  27. o Duplicate decleration of <var_name> ignored
  28. ---------------------------------------------
  29. Ok, so I've got two modules that both need to know the value of a particular
  30. global variable (i'm doing alot of low level interrupt stuff as well). So I
  31. define the global variable as
  32.  
  33.     extern "C" {uint clock_ticks;};
  34.  
  35. In the header file and include it with all the external function prototypes
  36. into my .cpp code. Everything compiles and links ok but I then get this
  37. "Redecleration of _clock_ticks ignored in module timer.cpp" The code still
  38. works, and everything is ok, but I wish that I didn't have this error :(
  39.  
  40. Thanks,
  41.  
  42. Paul
  43.  
  44.  
  45.  
  46.